FIELD OF THE INVENTION
Local Area Network (LAN) adapters are commonly used to attach computer systems to networks such as Ethernet, Token-Ring and FDDI. Most high performance LAN adapters operate as bus master devices on industry standard buses such as ISA, EISA, Micro Channel and PCI. As bus masters, they obtain ownership of the host computer system bus and directly transfer frames in and out of buffers located in main memory using a Direct Memory Access (DMA) process. Device driver software running in the host computer monitors and controls operation of the LAN adapter. A typical system configuration is illustrated in FIG. 1.
The device driver provides an interface between the LAN adapter and other software (hereafter application software) executing in the host computer system. The device driver interacts with the LAN adapter hardware by processing hardware interrupts, reading and writing adapter registers and servicing transmit and receive queues. The device driver interacts with the application software by servicing requests to transmit data onto the network and by forwarding data received from the network to the application software.
The vast majority of LAN adapter device driver software conform to either the Open Data-Link Interface (ODI) specification or the Network Driver Interface Specification (NDIS).
ODI and NDIS define the programming interface between the device driver and the application software. ODI was developed by Novell and is used in Novell's NetWare products, while NDIS was developed by 3 COM and Microsoft and is used in Windows operating systems. In general, bus master LAN adapters copy frames received from the LAN into a chain or linked list of buffers, allocated by the device driver, and resident in the host processor's main memory.
NDIS does not place a limitation on the number of buffers used to store a received frame, and when a received frame exceeds the storage capacity of a buffer, the excess is stored in one or more additional buffers as required and the device driver forwards the frame to the application software. On the other hand, the ODI device driver will not forward any frame which is greater than a single allocated buffer. Frames which exceed the capacity of a single buffer are discarded by the device driver as invalid.
Normally, ODI device drivers will allocate buffers having sufficient capacity to hold the largest frame that it expects to receive. This is determined by negotiation at the time the communication is established. However, under some circumstances (such as operating in a PC DOS environment) buffer sizes somewhat smaller than the maximum size supported by the LAN are selected. In those instances, it is necessary that the device driver perform an explicit check of every received frame to ensure that the buffer contains a complete frame. Otherwise, the device driver could forward a partial frame to the application software. Even though the check rarely fails, it must be done and has an adverse impact on the LAN adapter's performance by lengthening a critical device driver code path.